/**
 * action module
 */

var React = require("react");
var historyProvider = require("../../provider/historyProvider");
var Action = React.createClass({
    handleOnUndo: function (){
        historyProvider.undo();
    },
    handleOnRedo: function (){
        historyProvider.redo();
    },
    render: function (){
        return (
            <div className="suofang">
                <button onClick={this.handleOnUndo} type="button" className="redo icon-arrow-back" id='handleOnUndo' disabled={!historyProvider.canUndo()}>
                    <span></span>
                    <div className="nav_tip">{$._("Undo")}</div>
                </button>
                <button onClick={this.handleOnRedo} type="button" className="undo icon-arrow-forward" id='handleOnRedo' disabled={!historyProvider.canRedo()}>
                    <span></span>
                    <div className="nav_tip">{$._('Redo')}</div>
                </button>
            </div>
        )
    }
});

module.exports = Action;
